<?php
// 应用公共文件
function config_get($key, $default = null)
{
    return  'default';
}


function template_path_get(): string
{
    return app()->getRootPath() . config("view.view_dir_name") . '/index/' . config_get('template') . DIRECTORY_SEPARATOR;
}


function plugin_alias_get()
{
    return trim(request()->param("alias"), '\\/');
}

function plugin_method_get()
{
    return request()->param("method", "index");
}


function plugin_info_get($alias = '')
{
    $plugin = [
        'class' => $alias
    ];
    return $plugin;
}

function msg($status = "ok", $message = "success", $data = [])
{
    return json([
        "code" => $status,
        "msg" => $message,
        "data" => $data,
    ]);
}
